/* 
 * File:   ipd_equalization.h
 * Author: dima
 *
 * Created on 6 января 2015 г., 13:16
 */

#ifndef IPD_EQUALIZATION_H
#define	IPD_EQUALIZATION_H
namespace ipd
{

class ipd_img;

class ipd_equalization
{
public:
    ipd_equalization(ipd_img &img, int step_color = 15);
    virtual ~ipd_equalization();
    void convert_image(ipd_img &convertible_image);//convert Image
    inline int get_count_intervals(); //get number of intervals on the real line
    inline int get_count_points(); //get number of points on the real line
    int get_size_histogram(); //get the size of the histogram for each image type
    void get_XY(int index, double &x, double *&y); //get the X and Y value of the curve
    void get_histogram(int index, double *&h, double &x1, double &x2); //get the value of the histogram
private:
    ipd_equalization(const ipd_equalization& orig);
    void create_curve(); //create curve
    void create_histogram(); //create histogram
    void copy_histogram(double *orig_histogram); //copy histogram
    void copy_XY(double *orig_X, double *orig_Y); //X-axis values and Y-axis values
    void delete_histogram(); //delete histogram
    void delete_curve(); //delete curve
    void delete_KB(); //delete coefficients of the line
    void create_equation_monochrome(); //Creating an equation for direct interpolation values for monochrome
    void create_equation_RGB(); //Creating an equation for direct interpolation values for RGB
    const int step;
    double *histogram; //histogram
    double *X; //X-axis values
    double *Y; //Y-axis values
    double *K, *B; //The coefficients of the line y=k*x+b
    int count_intervals; // number of intervals on the real line
    int count_points; // number of points on the real line
    ipd_img &image;
};

int ipd_equalization::get_count_intervals()//get number of intervals on the real line
{
    return count_intervals;
}

int ipd_equalization::get_count_points() //get number of points on the real line
{
    return count_points;
}

}
#endif	/* IPD_EQUALIZATION_H */

